﻿// See https://aka.ms/new-console-template for more information

var eventID = Guid.NewGuid().ToString("N");
var authCenterUrl = Environment.GetEnvironmentVariable("AuthCenter") ?? "";
System.AuthCenter.Client.Manager.Init(authCenterUrl);



var res = await System.AuthCenter.Client.Manager.Login(new GCCGrpc.AuthCenter.LoginRequest()
{
    OpenKey = "test",
    Token = "test",
    Type = 0,
    CacheSecond = 30 * 60
}, eventID);
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(res));
var res1 = await System.AuthCenter.Client.Manager.SetUser(new GCCGrpc.AuthCenter.SetUserRequest()
{
    AccessToken = res.Token,
    OpenID = "test",
    OpenKey = "",
    RefreshToken = "",
    Type = 0,
    Token = "asdadasd",
    UID = LuanNiao.Core.IDGen.GetInstance().NextId(),
    UnionID = ""
}, eventID);




Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(res1, LuanNiao.JsonConverterExtends.CommonSerializerOptions.CamelCaseChineseNameCaseInsensitive));
var res2 = await System.AuthCenter.Client.Manager.GetUserLoginInfos(new GCCGrpc.AuthCenter.GetUserLoginInfosRequest()
{
    AccessToken = res.Token,
    UID = 1
}, eventID);




Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(res2, LuanNiao.JsonConverterExtends.CommonSerializerOptions.CamelCaseChineseNameCaseInsensitive));
